<?php
class HighSlide extends CWidget
{
	//mode for highrslide full, html,gallery
	public $mode = 'default';
	public function init()
	{
		//create asset manage
		$dir = dirname(__FILE__).DIRECTORY_SEPARATOR.'assets';
		$assets_url = Yii::app()->getAssetManager()->publish($dir);
		$ClientScript = Yii::app()->getClientScript();
		switch ($this->mode)
		{
			case 'full':
				$ClientScript->registerScriptFile("{$assets_url}/highslide-full.js");
				break;
			case 'html':
				$ClientScript->registerScriptFile("{$assets_url}/highslide-with-html.js");
				break;
			case 'gallery':
				$ClientScript->registerScriptFile("{$assets_url}/highslide-with-gallery.js");
				break;
			default:
				$ClientScript->registerScriptFile("{$assets_url}/highslide.js");
				break;
		}
		$ClientScript->registerCssFile("{$assets_url}/highslide.css");  
		parent::init();
	}
}